# include "processBar.h"
#include <unistd.h>

typedef void (*callback_t)(int);

void downLoad(callback_t cd)
{
    int total = 1000; //1000MB
    int curr = 0; //0MB
    while(curr <= total){
        usleep(50000);
        int rate=curr*100/total;
        cd(rate);
        curr+=10;
    }
    printf("\n");
}

int main()
{
    printf("download 1: \n");
    downLoad(processbar);
    initbar();
    printf("download 2: \n");
    downLoad(processbar);
    initbar();
    printf("download 3: \n");
    downLoad(processbar);
    initbar();
    printf("download 4: \n");
    downLoad(processbar);
    initbar();
    return 0;
}
